<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>权限功能</title>
</head>

<!--layui的CSS样式-->
<link type="text/css" rel="stylesheet" href="../lib/layuimini/lib/layui-v2.5.5/css/layui.css"/>
<!--layui的js-->
<script src="../lib/layuimini/lib/layui-v2.5.5/layui.js"></script>
<!--第三方下拉表格js-->
<script src="../lib/layuimini/js/lay-config.js"></script>
<!--自己js的路径-->
<script type="text/javascript" src="./js/menu.js"></script>




<script type="text/html" id="toolEventDemo">
    <a class="layui-btn layui-btn-xs" style="background-color: #1E9FFF" lay-event="edit"><i
            class="layui-icon">&#xe642;</i>编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
            class="layui-icon">&#xe640;</i>删除</a>
</script>


<body>


<!--表格元素 lay-filter 通过这个属性来筛选绑定的表格-->
<table id="mytable" lay-filter="mytable"></table>

<!--上方工具条-->
<!--lay-event 是跟js的Switch case 后的名字一样的-->
<script type="text/html" id="menuToolBar">
    <div style="float:right">
        <button class="layui-btn layui-btn-normal layui-btn layui-btn-sm" lay-event="add">
            <i class="layui-icon">&#xe654;</i>添加权限
        </button>
        <button class="layui-btn layui-btn-primary layui-btn layui-btn-sm" lay-event="deleteAll" style="color: #FF0000">
            <i class="layui-icon">&#xe640;</i>批量删除
        </button>
    </div>


    <!--  form表单  -->
    <form class="layui-form layui-col-space5">
        <!--功能名称模糊查询-->
        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能名称</label>
        </div>
        <div class="layui-inline layui-show-xs-block">
            <input class="layui-input" autocomplete="off" placeholder="请输入功能名称" name="menuName" id="menuName">
        </div>
        <!--功能编号模糊查询-->
        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能编号</label>
        </div>
        <div class="layui-inline layui-show-xs-block">
            <input class="layui-input" autocomplete="off" placeholder="请输入功能编号" name="menuId" id="menuId">
        </div>

        <!-- 模糊查询的按钮  -->
        <!-- type="button 这个是为了不让layui提交两次-->
        <div class="layui-inline layui-show-xs-block">
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-event="search"
                    lay-filter="sreach" type="button"><i class="layui-icon">&#xe615;</i>搜索
            </button>
        </div>
    </form>
</script>

<!--限制新增用户的时候用户输入的年龄 最小为1 最大为100岁 ：加了约束-->
<script type="text/javascript">
    function minmax(value, min, max)
    {
        if(parseInt(value) < min || isNaN(parseInt(value)))
            return min;
        else if(parseInt(value) > max)
            return max;
        else return value;
    }
</script>




<!--功能数据新增窗口-->
<div id="addMenu" style="width:100%;display: none; text-align: center;margin-top: 20px">
    <form id="addForm" class="layui-form layui-form-pane" style="display: inline-block" action="">
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">功能编号</label>
            <div class="layui-input-inline">
                <input type="text" name="menuId" lay-verify="required"
                       placeholder="请输入功能编号" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--请输入父功能编号-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">父功能编号</label>
            <div class="layui-input-inline">
                <input type="text" name="parentMenuId" lay-verify="required"
                       placeholder="请输入父功能编号" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--请输入功能类别-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能类别</label>
            <div class="layui-input-inline">
                <input type="text" name="menuType" lay-verify="required"
                       placeholder="请输入功能类别" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--功能名称-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能名称</label>
            <div class="layui-input-inline">
                <input type="text" name="menuName" lay-verify="required"
                       placeholder="请输入功能名称" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--菜单路径-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">菜单路径</label>
            <div class="layui-input-inline">
                <input type="text" name="menuClass" lay-verify="required"
                       placeholder="请输入菜单路径" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--功能菜单链接路径-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能菜单链接路径</label>
            <div class="layui-input-inline">
                <input type="text" name="menuUrl" lay-verify="required"
                       placeholder="请输入菜单路径" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--备注-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">描述</label>
            <div class="layui-input-inline">
                <input type="text" name="remark" lay-verify="required"
                       placeholder="备注" autocomplete="off" class="layui-input" >
            </div>
        </div>


        <div class="layui-form-item" >
            <button class="layui-btn"  style="background-color: #1E9FFF" lay-submit="" lay-filter="addMenu" >
                <i class="layui-icon">&#x1005;</i>添加
            </button>
            <button class="layui-btn layui-btn-primary" type="button" onclick="quxiao()" style="color: #FF0000">
                <i class="layui-icon">&#x1006;</i>取消
            </button>
        </div>
    </form>
</div>


<!--权限功能数据修改窗口-->
<div id="updateMenu" style="width:100%;display: none; text-align: center;margin-top: 20px">
    <form id="updateForm" class="layui-form layui-form-pane" lay-filter="myFrom2" style="display: inline-block" action="">

        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">功能编号</label>
            <div class="layui-input-inline">
                <input type="text" name="menuId" lay-verify="required"
                       placeholder="请输入功能编号" autocomplete="off" class="layui-input" readonly>
            </div>
        </div>

        <!--请输入父功能编号-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">父功能编号</label>
            <div class="layui-input-inline">
                <input type="text" name="parentMenuId" lay-verify="required"
                       placeholder="请输入父功能编号" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--请输入功能类别-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能类别</label>
            <div class="layui-input-inline">
                <input type="text" name="menuType" lay-verify="required"
                       placeholder="请输入功能类别" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--功能名称-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能名称</label>
            <div class="layui-input-inline">
                <input type="text" name="menuName" lay-verify="required"
                       placeholder="请输入功能名称" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--菜单路径-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">菜单路径</label>
            <div class="layui-input-inline">
                <input type="text" name="menuClass" lay-verify="required"
                       placeholder="请输入菜单路径" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--功能菜单链接路径-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">功能菜单链接路径</label>
            <div class="layui-input-inline">
                <input type="text" name="menuUrl" lay-verify="required"
                       placeholder="请输入菜单路径" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <!--备注-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">描述</label>
            <div class="layui-input-inline">
                <input type="text" name="remark" lay-verify="required"
                       placeholder="备注" autocomplete="off" class="layui-input" >
            </div>
        </div>


        <div class="layui-form-item" >
            <button class="layui-btn"  style="background-color: #1E9FFF" lay-submit="" lay-filter="updateMenu" >
                <i class="layui-icon">&#x1005;</i>修改
            </button>
            <button class="layui-btn layui-btn-primary" type="button" onclick="quxiao()" style="color: #FF0000">
                <i class="layui-icon">&#x1006;</i>取消
            </button>
        </div>
    </form>
</div>

</body>
</html>